package com.pac.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.pac.user.bean.UserHisBean;
import com.pac.user.dao.UserHisDao;
import com.pac.user.service.UserHisService;

/**
 * 病史患者Service实现
 * 
 * @author lujun.chen
 * @version [版本号, 2015年5月7日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Service(value = "userHisService")
public class UserHisServiceImpl implements UserHisService {

	@Autowired
	private UserHisDao userHisDao;

	@Override
	public List<UserHisBean> queryUserHis(UserHisBean userHisBean) {

		return userHisDao.queryUserHis(userHisBean);
	}

	@Override
	public UserHisBean findUserHis(UserHisBean userHisBean) {

		List<UserHisBean> userHisList = userHisDao.queryUserHis(userHisBean);
		if (null != userHisList && userHisList.size() > 0) {
			return userHisList.get(0);
		}

		return null;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public String addUserHis(UserHisBean userHisBean) {
		return userHisDao.addUserHis(userHisBean);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public boolean delUserHis(UserHisBean userHisBean) {
		return userHisDao.delUserHis(userHisBean);
	}

}
